<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
  <style>
    .el-header{
      background-color: #E8E3E3;

    }
    .el-main{
      width: 1200px;
      height: 1500px;
      margin: 0 auto;
    }
    .el-footer{
      height: 200px;
      background-color: #8C8686;
    }
    .avatar-uploader .el-upload {
      border: 1px dashed #d9d9d9;
      border-radius: 6px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }
    .avatar-uploader .el-upload:hover {
      border-color: #409EFF;
    }
    .avatar-uploader-icon {
      font-size: 28px;
      color: #8c939d;
      width: 178px;
      height: 178px;
      line-height: 178px;
      text-align: center;
    }
    .avatar {
      width: 178px;
      height: 178px;
      display: block;
    }
    #dh{
      width: 200px;height: 600px;
      float: left;
      padding: 5px 0 0 10px;
      border: 1px solid #D3DCE6;
    }
    #nr{
      margin-right: 80px;
      float: right;
    }
    #d1{
      width: 600px;height: 1000px;
      padding: 10px;
      overflow: hidden;
    }
    #d2{
      width: 180px;height: 180px;
      margin: 0 0 30px;
    }
    #d3{
      width: 500px;height: 700px;
      padding: 30px 60px 10px 0;
    }
    #d4{
      width: 500px;height: 10px;
      margin: 3px 0 25px 5px;
    }
    #d5{
      width: 800px;height: 300px;
      border: 2px solid #8C8686;
      margin: 50px 0 0 10px;
      overflow: hidden;
    }
    a{
      text-decoration: none;
    }
  </style>
</head>
<body>
<div id="app">
  <el-container>
    <el-header height="200px">Header</el-header>
  <el-main>
    <!--导航栏开始-->
    <div id="dh">
          <el-menu
                  default-active="2"
                  class="el-menu-vertical-demo"
                  @open="handleOpen"
                  @close="handleClose">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>我的常用链接</span>
              </template>
              <el-submenu index="1-1">
                <template slot="title">我的交易</template>
                <el-menu-item index="1-1-1">我的订单</el-menu-item>
              </el-submenu>
              <el-submenu index="1-2">
                <template slot="title">我的收藏</template>
                <el-menu-item index="1-2-1">商品收藏</el-menu-item>
              </el-submenu>
              <el-submenu index="1-3">
                <template slot="title">个人中心</template>
                <a href="/userInfo.html"> <el-menu-item index="1-3-1">个人信息</el-menu-item></a>
                <el-menu-item index="1-3-2">修改密码</el-menu-item>
                <a href="/address.html"><el-menu-item index="1-3-3">收货地址</el-menu-item></a>
              </el-submenu>
            </el-submenu>
          </el-menu>
    </div>
          <!--导航栏结束-->
    <div id="nr">
     <div id="d4">
            <span>编辑个人档案 (带*号的项目为必填项)</span>
            <hr style="width: 656px">
     </div>
     <div id="d1">

        <span>请上传头像</span>
        <div id="d2">
          <!--上传头像开始-->
          <el-upload
                  class="avatar-uploader"
                  action="https://jsonplaceholder.typicode.com/posts/"
                  :show-file-list="false"
                  :on-success="handleAvatarSuccess">
            <img v-if="imageUrl" :src="imageUrl" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
           <!--上传头像结束-->
           </div>
           <div id="d3">
              <!--个人信息开始-->
              <el-form ref="form"  label-width="80px">
                <el-form-item label="*昵称">
                  <el-input v-model="user.nickname" placeholder="请输入昵称"></el-input>
                </el-form-item>
                <el-form-item label="*居住地">
                  <el-select v-model="user.address" placeholder="请选择活动区域">
                    <el-option label="区域一" value="shanghai"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="*性别">
                  <el-radio-group v-model="user.gender">
                    <el-radio label="男"></el-radio>
                    <el-radio label="女"></el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="身份">
                  <el-radio-group v-model="user.status">
                    <el-radio label="在校学生"></el-radio>
                    <el-radio label="教师"></el-radio>
                    <el-radio label="上班族"></el-radio>
                    <el-radio label="自由职业"></el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="生日">
                  <el-col :span="11">
                    <el-date-picker type="date" placeholder="选择日期" v-model="user.birthday" style="width: 100%;"></el-date-picker>
                  </el-col>
                </el-form-item>
                <el-form-item label="博客地">
                  <el-input v-model="user.blogs" placeholder="http://"></el-input>
                </el-form-item>
                <el-form-item label="居住状态">
                  <el-checkbox-group v-model="user.dwellingState">
                    <el-checkbox label="独居" ></el-checkbox>
                    <el-checkbox label="和伴侣" ></el-checkbox>
                    <el-checkbox label="和室友" ></el-checkbox>
                    <el-checkbox label="和父母" ></el-checkbox>
                    <el-checkbox label="和孩子" ></el-checkbox>
                    <el-checkbox label="和宠物" ></el-checkbox>
                  </el-checkbox-group>
                </el-form-item>
                <el-form-item label="兴趣爱好">
                  <el-input type="textarea" v-model="user.hobbies"></el-input>
                </el-form-item>
                <el-form-item label="自我介绍" >
                <el-input type="textarea" v-model="user.introduction"></el-input>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" @click="push()">保存基本信息</el-button>
                </el-form-item>
              </el-form>
              <!--个人信息结束-->
            </div>
        </div>
     <div id="d5">
            <!--轮播图开始-->
            <el-carousel height="300px">
              <el-carousel-item>
                <img src="" width="100%" height="100%" alt="">
              </el-carousel-item>
              <el-carousel-item>
                <img src="" width="100%" height="100%" alt="">
              </el-carousel-item>
              <el-carousel-item>
                <img src="" width="100%" height="100%" alt="">
              </el-carousel-item>
            </el-carousel>
            <!--轮播图结束-->
          </div>
    </div>
  </el-main>
      <el-footer>Footer</el-footer>
  </el-container>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
  let v = new Vue({
    el: '#app',
    data: function() {
      return {
        imageUrl: '',
        user:{
          dwellingState:[]
        },
      };
    },
    methods: {
      push() {
        console.log('submit!');
        axios.post("/userinfo/insert").then(function (response) {

        })
      },
      handleAvatarSuccess(res, file) {
        this.imageUrl = URL.createObjectURL(file.raw);
      },
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      }
    }
  })
</script>
</html>